$(".checkbox1").addEventListener('click',function(){
    if ($(".checkbox1").checked===true) {
        $(".submitbtn").style.backgroundColor = "deepskyblue"
         $(".submitbtn").style.color = "white"
          $(".submitbtn").style.cursor = "pointer"
    }else{
        $(".submitbtn").style.backgroundColor = ""
        $(".submitbtn").style.color = ""
        $(".submitbtn").style.cursor = ""
    }
    
})
$a(".inputjs").forEach(function(v,i){
    // console.log(v,i);
    v.addEventListener('input',function(){
            // console.log(a);
            if (v.value.length>0) {
                $a(".icon-chacha")[i].style.display = "block"
            }else{
               $a(".icon-chacha")[i].style.display = "none" 
            }
        
    })
})
$a(".icon-chacha").forEach(function(e,i){
    e.addEventListener('click',function(){
$a(".inputjs")[i].value = ""
    })
})

$a(".inputjs")[0].addEventListener("blur", function () {
    console.log(1);
  let a = /^[a-zA-Z][a-zA-Z0-9_]{5,11}$/
  let b= a.test($a(".inputjs")[0].value);
  if (!b) { 
    console.log(1);
    $(".box7").style.display ="block"
  }
  else {
    $(".box7").style.display = "none";
  }
})
// 手机号码 
$a(".inputjs")[1].addEventListener("blur", function () {
    console.log(1);
  let a = /^1[345678][0-9]{9}$/
  let b= a.test($a(".inputjs")[1].value);
  if (!b) { 
    console.log(1);
    $(".box8").style.display ="block"
  }
  else {
    $(".box8").style.display = "none";
  }
})

// 手机验证码
$a(".inputjs")[2].addEventListener("blur", function () {
    console.log(1);
  let a = /^[a-zA-Z][a-zA-Z0-9_]{3}$/
  let b= a.test($a(".inputjs")[2].value);
  if (!b) { 
    console.log(1);
    $(".box9").style.display ="block"
  }
  else {
    $(".box9").style.display = "none";
  }
})
// 密码
$a(".inputjs")[3].addEventListener("blur", function () {
    console.log(1);
  let a = /^[a-zA-Z][a-zA-Z0-9_]{5,11}$/
  let b= a.test($a(".inputjs")[3].value);
  if (!b) { 
    console.log(1);
    $(".box10").style.display ="block"
  }
  else {
    $(".box10").style.display = "none";
  }
})